{% extends 'base.html' %}
{% load static %}

{% block main %}
    {% for post in post_list %}
    <article class="post post-{{ post.pk }} mb-5 card shadow-sm hover-shadow transition-all">
        <header class="entry-header card-header">
            <h1 class="entry-title">
                <a href="{{ post.get_absolute_url }}">{{post.title}}</a>
            </h1>
            <div class="entry-meta">
                <span class="post-category"><a href="#">{{post.category.name}}</a></span>
                <span class="separator">|</span>
                <span class="post-date"><a href="#"><time class="entry-date"
                     datetime="{{post.createtime}}">{{post.createtime}}</time></a></span>
                <span class="separator">|</span>
                <span class="post-author"><a href="#">{{ post.author }}</a></span>
                <span class="separator">|</span>
                <span class="comments-link">
                    <a href="{{ post.get_absolute_url }}#comment-area">{{ post.comment_set.count }} 评论</a>
                </span>
                <span class="separator">|</span>
            </div>
        </header>
        <div class="entry-content clearfix card-body">
            <p class="card-text">{{ post.excerpt }}</p>
            <div class="read-more cl-effect-14 mt-3">
                <a href="{{ post.get_absolute_url }}" class="more-link btn btn-outline-primary">
                    继续阅读 <span class="meta-nav">→</span>
                </a>
            </div>
        </div>
    </article>
    {% empty %}
      <div class="no-post">暂时还没有发布的文章！</div>
    {% endfor %}

{% endblock main %}
